package demo.loop;

import java.util.Scanner;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/7/20-07-20-14:13
 * @Description：demo.loop
 */
public class If_01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个年份：");
        int year = sc.nextInt();
        if(isLeapYear(year)){
            System.out.println(year + "年是闰年啦!!");
        }else{
            System.out.println(year + "年是平年哦！");
        }
    }

    public static boolean isLeapYear(int year) {
//        boolean flag = false;
//        if(year%4==0&&year%100!=0||year%400==0){
//            flag = true;
//        }
//        return flag;
        return year%4==0&&year%100!=0||year%400==0;
    }
}
